﻿using ETask.Api.Dtos;
using ETask.Api.Mappers;
using ETask.Api.Models;
using ETask.Api.Repositories;

namespace ETask.Api.Services
{
    public class ProjectTaskService : GenericService<ProjectTask, ProjectTaskDto, CreateProjectTaskDto, UpdateProjectTaskDto>, IProjectTaskService
    {

        private readonly IProjectTaskRepository _repository;

        public ProjectTaskService(IProjectTaskRepository repository, GenericMapper<ProjectTask, ProjectTaskDto, CreateProjectTaskDto, UpdateProjectTaskDto> mapper) : base(repository, mapper)
        {
            _repository = repository;
        }

        public async Task<ApiResponse> GetListAsync(ProjectTaskListParams listParams)
        {
            var res = await _repository.GetListAsync(listParams);
            return ApiResponse.Ok(res);
        }
    }
}
